﻿using System;
using System.Collections.Generic;
using System.Text;
using SharpHomeEngine;

namespace DeviceInterfaceTest
{
    
    public class TestLightSwitch : TestDevice
    {
        internal TagDigital Switch;

        public TestLightSwitch(TestDeviceInterface DeviceInterface, string Name)
            : base(DeviceInterface, Name)
        {
            Switch = new TagDigital(DeviceInterface, this, "Switch");
        }

        public bool ChangeState(Tag Tag, object Value)
        {
            if (Tag.Name == Switch.Name)
            {
                if (Switch.IsSameValueType(Value))
                {
                    //simulate going out over the wire and making the change.
                    System.Threading.Thread.Sleep(300);
                    return true;
                }
            }
            return false;
        }
    }
     
}
